﻿Imports System.CodeDom
Imports System.Reflection
Imports System.CodeDom.Compiler
Imports System.IO

Public Class frmGeneratingForm
    Dim formGen As FormGen
    Const PATH_ALL_TEMPATES As String = "..\Debug\Templates"

    Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub

    Sub New(ByVal IsTemplatePath As String, ByVal IsSaveFormPath As String, ByVal IsUnitName As String, ByRef IoDat As Dat)

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

        formGen = New FormGen(Path.Combine(IsTemplatePath, "Templates"), Path.Combine(IsSaveFormPath, "VygenerovaneFormulare"), IsUnitName, IoDat)
        cmbBxTmpls.Items.AddRange(formGen.fillTmplsCmbBx().ToArray)
        cmbBxTmpls.SelectedIndex = 0
    End Sub

    ' generovanie formularov
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerateForm.Click

        formGen.generateFormular(cmbBxTmpls.SelectedItem.ToString())
    End Sub
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefreshTmpls.Click
        cmbBxTmpls.Items.AddRange(formGen.fillTmplsCmbBx().ToArray)
        cmbBxTmpls.SelectedIndex = 0
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'formGen.createDirectory("xx", "Standard")

    End Sub

End Class

